local M = _G.ServerOHOH.class.new(script,_G.ServerOHOH.files.Server_PlayerComponent(),script.Parent.Name);
local ServerOHOH = _G.ServerOHOH;
local ItemTool=_G.CommonOHOH.load.ItemTool()
local EventList = ServerOHOH.load.EventList();
local function_list = ServerOHOH.function_list;
local afk_cfg =require(script.Parent.cfg)
function M.new(self,...)
    M(self,...);
end

function M.ctor(self,parent)
    M.super.ctor(self,parent)
    self.player = self.parent
    self.DataStore = self.parent:GetComponent(_G.ServerOHOH.load.Server_PlayerDataComponent());
    self.AFKObjList={}
    for _,v in pairs(afk_cfg) do
        self.AFKObjList[v.id]=require(script.Parent:FindFirstChild(v.class)).new(self.player,v.titleId,v.value, self.DataStore)
    end

end

--触发事件
function M.InformAFK(self,isIn)
    if isIn then
        self.player.InAFKEvent:Action()
    else
        self.player.OutAFKEvent:Action( )
    end
end

M:RegistFunction(function_list.inform_afk,M.InformAFK)

function M.dtor(self)
    M.super.dtor(self)
end

return M